package myexchange

import grails.test.*

class GameServiceTests extends GrailsUnitTestCase {
	
	GameService gameService
	CardService cardService
	
    protected void setUp() {
        super.setUp()
		gameService = new GameService()
		cardService = new CardService()
		gameService.cardService = cardService
		cardService.gameService = gameService
    }

    protected void tearDown() {
        super.tearDown()
    }

    void testStartGame() {
		
		//is called in bootstrap gameService.startGame()
		
		Game game = gameService.getActiveGame()
		
		Player.list().each {player ->
			(1..5).each{it ->
				assertEquals(5 ,player.cards.size())
			}
		}

		
		
    }
	
}
